# -*- mode:makefile -*-;

include ../SETTINGS
include ../COMMON

SOURCES = asset_access.pl basic_types.pl certification_access.pl \
	  cipher.pl database_access.pl database_impl.pl \
	  dictionary_access.pl fake.pl general_check.pl \
	  ontology_access.pl organization_access.pl \
	  resource_access.pl test.pl user_access.pl  

PERSDB_IMPL=persdb_impl.pl
DB_IMPL=db_impl.pl
MYSQL_IMPL=mysql_impl.pl

DUMP_CONECTA2AMOS=dump_conecta2amos
DUMP_DATABASE=dump_database

foo:
	@echo Please state a target

# CIAOALIAS has a value assigned in ../Makefile
compile: 
	CIAOALIASPATH=$(CIAOALIAS) $(CIAOC) -c $(SOURCES)

compile-dumps:
	CIAOALIASPATH=$(CIAOALIAS) $(CIAOC) $(DUMP_CONECTA2AMOS)
	CIAOALIASPATH=$(CIAOALIAS) $(CIAOC) $(DUMP_DATABASE)

run-dump-conecta2amos:
	./$(DUMP_CONECTA2AMOS)

run-dump-persdb2mysql:
	./$(DUMP_DATABASE) persdb

run-dump-mysql2persdb:
	./$(DUMP_DATABASE) mysql

gen-database-link-persdb:
	-rm -f $(DB_IMPL)
	ln -s $(PERSDB_IMPL) $(DB_IMPL)

gen-database-link-mysql:
	-rm -f $(DB_IMPL)
	ln -s $(MYSQL_IMPL) $(DB_IMPL)

clean:
	rm -f *.po *.itf

distclean: clean
	rm -rf *~

